package com.huanmeiqi.demo.persistence.two;

import com.huanmeiqi.demo.persistence.two.dao.TOrderDAO;
import com.huanmeiqi.demo.persistence.two.domain.TOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author cq.Wang
 * @date 2018/6/15 17:40
 * @description
 */
@RestController
@RequestMapping("orders")
public class TestController {

    @Autowired
    private TOrderDAO tOrderDAO;

    @PostMapping("{orderId}")
    public void insetXX(@PathVariable Long orderId) {
        TOrder tOrder = new TOrder();
        tOrder.setDbNo(1);
        tOrder.setOrderType("T");
        tOrder.setOrderId(orderId);
        tOrderDAO.insertTOrder(tOrder);
    }

    @GetMapping("{orderId}")
    public TOrder selectXX(@PathVariable Long orderId) {
        return tOrderDAO.selectTOrder(orderId);
    }
}
